﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VersionSwitcher.Loggers;
using VersionSwitcher.Constants;
using System.Diagnostics;

namespace VersionSwitcher.Workers
{
    public class SvnWorker
    {
        private ILogger logger;
        private string mainSvnPath = String.Empty;

        public SvnWorker(string versionOrPath, bool isAutoMode, ILogger logger)
        {
            this.logger = logger;
            if (isAutoMode)
            {
                mainSvnPath = SvnPaths.RootForBranch + versionOrPath;
            }
            else
            {
                mainSvnPath = versionOrPath;
            }
        }

        public void SaveFile(string relativeUrl, string saveToPath)
        {
            Process.Start(FolderFilePaths.TortoiseProc, String.Format(Arguments.Cat, mainSvnPath + relativeUrl, saveToPath));
        }
    }
}
